package io.github.talelin.latticy.service.feign;

import io.github.talelin.latticy.model.MsgLogDO;
import io.github.talelin.latticy.vo.CreatedVO;
import io.github.talelin.latticy.vo.UpdatedVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @ClassName：OmsFeignClient
 * @Author: wulongbo
 * @Date: 2022/8/1 21:32
 */
@FeignClient(value = "oms-server")
public interface OmsMsgLogFeignClient {

    /**
     * 创建一条日志记录
     *
     * @param msgLogDO    日志消息
     * @return 是否成功
     */
    @PostMapping("/v1/msg-log/create")
    CreatedVO createMsgLog(@RequestBody MsgLogDO msgLogDO);

    /**
     * 修改一条日志记录
     *
     * @param msgLogDO    日志消息
     * @return 是否成功
     */
    @PostMapping("/v1/msg-log/update")
    UpdatedVO updateById(@RequestBody MsgLogDO msgLogDO);

    /**
     * 查询一条日志记录
     *
     * @param id    日志id
     * @return MsgLogDO
     */
    @GetMapping("/v1/msg-log/{id}")
    MsgLogDO getMsgLogById(@PathVariable(value = "id") Long id);

}
